extern crate cc;

fn main() {
    let files = vec![
        "./src/fastcdc_chunking.c",
        "./src/rabin_chunking.c",
        "./src/spooky_c.c",
        "./src/md5.c",
    ];
    //println!("cargo:rerun-if-env-changed=CC");
    
    println!("cargo:rustc-link-lib=dylib=isal_crypto");
    
    for file in files.iter() {
        println!("cargo:rerun-if-changed={file}");
    }
    cc::Build::new()
        .compiler("gcc-9")
        .files(files)
        .flag("-g")
        .flag("-O3")
        .flag("-w")
        .flag("-mavx2")
        .flag("-mavx512f")
        .flag("-mavx512bw")
        .flag("-mavx512dq")
        .flag("-std=gnu99")
        .flag("-lisal_crypto")
        .compile("libsuperf.a");
}